package com.example.demo.rabbitmq;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: HouZeYu
 * @Description:
 * @Date: Created in 14:37 2019/8/8
 */
@Configuration
public class TopicConfiguration {

    @Bean
    public Queue queueA(){
        return new Queue("topicC");
    }

    @Bean
    public TopicExchange topicExchange(){
        return new TopicExchange("topicExchange");
    }

    @Bean
    Binding binding(){
        return BindingBuilder.bind(queueA()).to(topicExchange()).with("topic");
    }
}

